{% extends 'base.html' %}
{% load widget_tweaks %}

{% block content %}
<div class="container mt-4">
    <h2 class="mb-4">{% if object %}编辑任务{% else %}创建任务{% endif %}</h2>
    <form method="post">
        {% csrf_token %}
        <div class="mb-3">
            <label for="{{ form.task_type.id_for_label }}" class="form-label">任务类型</label>
            {{ form.task_type|add_class:'form-control' }}
        </div>
        <div class="mb-3">
            <label for="{{ form.task_id.id_for_label }}" class="form-label">任务 ID</label>
            {{ form.task_id|add_class:'form-control' }}
        </div>
        <div class="mb-3">
            <label for="{{ form.task_title.id_for_label }}" class="form-label">任务标题</label>
            {{ form.task_title|add_class:'form-control' }}
        </div>
        <div class="mb-3">
            <label for="{{ form.assignee.id_for_label }}" class="form-label">负责人</label>
            {{ form.assignee|add_class:'form-control' }}
        </div>
        <div class="mb-3">
            <label for="{{ form.status.id_for_label }}" class="form-label">状态</label>
            {{ form.status|add_class:'form-control' }}
        </div>
        <div class="mb-3">
            <label for="{{ form.highlight.id_for_label }}" class="form-label">高亮</label>
            {{ form.highlight|add_class:'form-control' }}
        </div>
        <div class="mb-3">
            <label for="{{ form.dev_comment.id_for_label }}" class="form-label">开发备注</label>
            {{ form.dev_comment|add_class:'form-control' }}
        </div>
        <div class="mb-3">
            <label for="{{ form.next_action.id_for_label }}" class="form-label">下一步行动</label>
            {{ form.next_action|add_class:'form-control' }}
        </div>
        <div class="mb-3">
            <label for="{{ form.logs.id_for_label }}" class="form-label">任务日志</label>
            {{ form.logs|add_class:'form-control' }}
        </div>
        <button type="submit" class="btn btn-primary">保存</button>
        <a href="{% url 'task_list' %}" class="btn btn-secondary">取消</a>
    </form>
</div>
{% endblock %}